
public class db_wall_lock {
	public int iWriters;
	public void getWallLock () throws Exception{
		synchronized(this) {
			while (iWriters > 0)
				this.wait();
			//System.out.println(Thread.currentThread().getId() + " got the wall lock"); 
			iWriters++;
		}
	}

	public void releaseWallLock() {
		synchronized(this) {
			iWriters--;
			//System.out.println(Thread.currentThread().getId() + " released wall lock"); 
			this.notifyAll();
			
		}
	}
}
